package com.elitesland.core.constant;

/**
 * @ClassName: UdcEnum 枚举
 * @Description: udc枚举
 */
public enum UdcEnum {

    // 商品评价级别
    ITM_ITEM_EVALUATE_LEVEL_SENIOR("ITM", "ITM_ITEM_EVALUATE_LEVEL", "商品评价级别", "SENIOR", "好评"),
    ITM_ITEM_EVALUATE_LEVEL_MIDDLE("ITM", "ITM_ITEM_EVALUATE_LEVEL", "商品评价级别", "MIDDLE", "中评"),
    ITM_ITEM_EVALUATE_LEVEL_NEGATIVE("ITM", "ITM_ITEM_EVALUATE_LEVEL", "商品评价级别", "NEGATIVE", "差评"),

    //商品评价类型
    ITM_ITEM_EVALUATE_TYPE_FIRST("ITM", "ITM_ITEM_EVALUATE_TYPE", "商品评价类型", "FIRST", "首评"),
    ITM_ITEM_EVALUATE_TYPE_LAST("ITM", "ITM_ITEM_EVALUATE_TYPE", "商品评价类型", "LAST", "追评"),

    // 商品的推荐类型
    ITM_ITEM_RECOMMEND_NEW("ITM", "ITM_ITEM_RECOMMEND", "商品推荐", "NEW", "新品"),
    ITM_ITEM_RECOMMEND_RE("ITM", "ITM_ITEM_RECOMMEND", "商品推荐", "RE", "推荐"),

    // 商品的服务保证
    ITM_ITEM_SERVICES_WYTH("ITM", "ITM_ITEM_SERVICES", "服务保证", "WYTH", "无忧退货"),
    ITM_ITEM_SERVICES_KSTK("ITM", "ITM_ITEM_SERVICES", "服务保证", "KSTK", "快速退款"),
    ITM_ITEM_SERVICES_MFBY("ITM", "ITM_ITEM_SERVICES", "服务保证", "MFBY", "免费包邮"),

    // 商品属性的类型
    ITM_ATTR_TYPE_SALE("ITM", "ITM_ATTR_TYPE", "属性类型", "SALE", "销售属性"),
    ITM_ATTR_TYPE_DESC("ITM", "ITM_ATTR_TYPE", "属性类型", "DESC", "描述属性"),

    // 商品属性的检索类型
    ITM_ATTR_SEARCH_TYPE_NO("ITM", "ITM_ATTR_SEARCH_TYPE", "检索类型", "NO", "不需要检索"),
    ITM_ATTR_SEARCH_TYPE_KEYWORD("ITM", "ITM_ATTR_SEARCH_TYPE", "检索类型", "KEYWORD", "关键字检索"),
    ITM_ATTR_SEARCH_TYPE_RANGE("ITM", "ITM_ATTR_SEARCH_TYPE", "检索类型", "RANGE", "范围检索"),

    // 商品属性的可选类型
    ITM_ATTR_CHOOSE_TYPE_UNIQUE("ITM", "ITM_ATTR_CHOOSE_TYPE", "可选类型", "UNIQUE", "唯一属性"),
    ITM_ATTR_CHOOSE_TYPE_SINGLE("ITM", "ITM_ATTR_CHOOSE_TYPE", "可选类型", "SINGLE", "单选属性"),
    ITM_ATTR_CHOOSE_TYPE_COMPLEX("ITM", "ITM_ATTR_CHOOSE_TYPE", "可选类型", "COMPLEX", "复选属性"),

    // 商品属性的录入方式
    ITM_ATTR_INPUT_TYPE_MANUAL("ITM", "ITM_ATTR_INPUT_TYPE", "录入方式", "MANUAL", "手工录入"),
    ITM_ATTR_INPUT_TYPE_SELECT("ITM", "ITM_ATTR_INPUT_TYPE", "录入方式", "SELECT", "下拉列表选择"),

    //订单状态
    STC_ORDER_STATUS_UNPAID("STC","STC_ORDER_STATUS","订单状态","UNPAID","待付款"),
    STC_ORDER_STATUS_PAYING("STC","STC_ORDER_STATUS","订单状态","PAYING","支付中"),
    STC_ORDER_STATUS_CANCEL("STC","STC_ORDER_STATUS","订单状态","CANCEL","已取消"),
    STC_ORDER_STATUS_CLOSE("STC","STC_ORDER_STATUS","订单状态","CLOSE","已关闭"),
    STC_ORDER_STATUS_UNDELIVERED("STC","STC_ORDER_STATUS","订单状态","UNDELIVERED","待发货"),
    STC_ORDER_STATUS_UNRECEIVED("STC","STC_ORDER_STATUS","订单状态","RECEIVED","待签收"),
    STC_ORDER_STATUS_EVALUATE("STC","STC_ORDER_STATUS","订单状态","EVALUATE","待评价"),
    STC_ORDER_STATUS_COMPLETED("STC","STC_ORDER_STATUS","订单状态","COMPLETED","已完成"),

    //订单支付状态
    STC_ORDER_PAY_STATUS_UNPAID("STC","STC_ORDER_PAY_STATUS","订单支付状态","UNPAID","待付款"),
    STC_ORDER_PAY_STATUS_PAID("STC","STC_ORDER_PAY_STATUS","订单支付状态","PAID","已付款"),

    // 发票状态
    STC_ORDER_INVOICE_STATE_INIT("STC","INVOICE_STATE","发票状态","INIT","初始化"),
    STC_ORDER_INVOICE_STATE_WAIT("STC","INVOICE_STATE","发票状态","WAIT","待开发票"),
    STC_ORDER_INVOICE_STATE_DONE("STC","INVOICE_STATE","发票状态","DONE","已开发票"),

    // 支付状态
    STC_PAY_RECORD_STATE_WAIT("STC","PAY_RECORD_STATE","支付状态","WAIT","待支付"),
    STC_PAY_RECORD_STATE_PAYING("STC","PAY_RECORD_STATE","支付状态","PAYING","支付中"),
    STC_PAY_RECORD_STATE_DONE("STC","PAY_RECORD_STATE","支付状态","DONE","已支付"),

    //订单发货状态
    STC_ORDER_DELIVER_STATUS("STC","STC_ORDER_DELIVER_STATUS","发货状态","DELIVERED","已发货"),
    STC_ORDER_UNDELIVER_STATUS("STC","STC_ORDER_DELIVER_STATUS","发货状态","UNDELIVERED","待发货"),
    STC_ORDER_RECEIVED_STATUS("STC","STC_ORDER_DELIVER_STATUS","发货状态","RECEIVED","已签收"),

    //订单类型
    STC_ORDER_TYPE_COMMON("STC","STC_ORDER_TYPE","订单类型","COMMON","普通订单"),
    STC_ORDER_TYPE_SECKILL("STC","STC_ORDER_TYPE","订单类型","SECKILL","秒杀订单"),

    //订单来源
    STC_ORDER_SOURCE_APPLET("STC","STC_ORDER_SOURCE","订单来源","APPLET","小程序"),
    STC_ORDER_SOURCE_APP("STC","STC_ORDER_SOURCE","订单来源","APP","APP"),

    //区域分类
    COM_AREA_CATEGORY_PROVINCE("COM","AREA_CATEGORY","区域分类","PROVINCE","省份"),
    COM_AREA_CATEGORY_CITY("COM","AREA_CATEGORY","区域分类","CITY","市"),
    COM_AREA_CATEGORY_COUNTRY("COM","AREA_CATEGORY","区域分类","COUNTRY","县（区）"),
    COM_AREA_CATEGORY_STREET("COM","AREA_CATEGORY","区域分类","STREET","乡（镇、街道）"),

    COM_GENDER_MALE("COM","COM_GENDER","性别","MALE","男"),
    COM_GENDER_FEMALE("COM","COM_GENDER","性别","FEMALE","女"),
    COM_GENDER_SECRET("COM","COM_GENDER","性别","SECRET","保密"),

    COM_PLAT_FORM_ALL("COM","PLAT_FORM","适用平台","ALL","全平台"),
    COM_PLAT_FORM_WEB("COM","PLAT_FORM","适用平台","WEB","PC端"),
    COM_PLAT_FORM_MOBILE("COM","PLAT_FORM","适用平台","MOBILE","移动端"),
    
    COM_VALID_TYPE_DATE("COM","VALID_TYPE","有效期类型","DATE","日期范围"),
    COM_VALID_TYPE_DAYS("COM","VALID_TYPE","有效期类型","DAYS","固定天数"),

    COM_UNIT_WEIGHT_GRAM("COM","UNIT_WEIGHT","重量单位","GRAM","克"),
    COM_UNIT_WEIGHT_KILOGRAM("COM","UNIT_WEIGHT","重量单位","KILOGRAM","千克"),

    COM_APPR_STATUS_DRAFT("COM","APPR_STATUS","审批状态","DRAFT","待提交"),
    COM_APPR_STATUS_APPROVING("COM","APPR_STATUS","审批状态","APPROVING","审批中"),
    COM_APPR_STATUS_APPROVED("COM","APPR_STATUS","审批状态","APPROVED","已批准"),
    COM_APPR_STATUS_REJECTED("COM","APPR_STATUS","审批状态","REJECTED","已拒绝"),

    //营销相关
    MKT_COUPON_CATEGORY_REGISTER("MKT","COUPON_CATEGORY","优惠券类型","REGISTER","注册赠券"),
    MKT_COUPON_CATEGORY_PURCHASE("MKT","COUPON_CATEGORY","优惠券类型","PURCHASE","购物赠券"),
    MKT_COUPON_CATEGORY_WHOLE("MKT","COUPON_CATEGORY","优惠券类型","WHOLE","全场赠券"),
    MKT_COUPON_CATEGORY_MEMBER("MKT","COUPON_CATEGORY","优惠券类型","MEMBER","会员赠券"),
    
    MKT_SUITABLE_TYPE_ALL("MKT","SUITABLE_TYPE","可使用商品类型","ALL","全部通用"),
    MKT_SUITABLE_TYPE_ITEM("MKT","SUITABLE_TYPE","可使用商品类型","ITEM","指定商品"),
    MKT_SUITABLE_TYPE_CAT("MKT","SUITABLE_TYPE","可使用商品类型","CAT","指定分类"),
    
    MKT_JOIN_MEMBER_TYPE_ALL("MKT","JOIN_MEMBER_TYPE","参与会员","ALL","全部会员"),
    MKT_JOIN_MEMBER_TYPE_PART("MKT","JOIN_MEMBER_TYPE","参与会员","PART","部分等级会员"),
    
    MKT_ITM_TYPE_USE("MKT","ITM_TYPE","商品或分类的类型（使用或者获取条件）","USE","可使用商品/类型"),
    MKT_ITM_TYPE_CONDITION("MKT","ITM_TYPE","商品或分类的类型（使用或者获取条件）","CONDITION","可赠送商品/类型"),
    
    MKT_COUPON_STATUS_NOUSE("MKT","COUPON_STATUS","优惠券状态","NOUSE","未使用"),
    MKT_COUPON_STATUS_USED("MKT","COUPON_STATUS","优惠券状态","USED","已使用"),
    MKT_COUPON_STATUS_PAST("MKT","COUPON_STATUS","优惠券状态","PAST","已过期"),
    MKT_COUPON_STATUS_VALID("MKT","COUPON_STATUS","优惠券状态","VALID","未过期"),

    MKT_COUPON_RECEIVE_TYPE_SYS("MKT","COUPON_RECEIVE_TYPE","优惠券领取方式","SYS","后台赠送"),
    MKT_COUPON_RECEIVE_TYPE_USER("MKT","COUPON_RECEIVE_TYPE","优惠券领取方式","USER","主动领取"),


    //运费模板设置:费用计算方式
    TMS_FARE_CALC_METHOD_WEIGHT("TMS","FARE_CALC_METHOD","费用计算方式","WEIGHT","按重量计算"),
    TMS_FARE_CALC_METHOD_NUM("TMS","FARE_CALC_METHOD","费用计算方式","NUM","按商品件数计算"),

    // 会员收藏类型
    SCRM_COLLECT_CATEGORY_ITEM("SCRM", "SCRM_COLLECT_CATEGORY", "收藏类型", "ITEM", "商品"),

    // 发票类型
    SCRM_INVOICE_CATEGORY_DZ("SCRM", "INVOICE_CATEGORY", "发票类型", "DZ", "电子发票"),
    SCRM_INVOICE_CATEGORY_ZZ("SCRM", "INVOICE_CATEGORY", "发票类型", "ZZ", "增值税专用发票"),

    // 发票抬头
    SCRM_INVOICE_HEAD_SELF("SCRM", "INVOICE_HEAD", "发票抬头", "SELF", "个人"),
    SCRM_INVOICE_HEAD_COMPANY("SCRM", "INVOICE_HEAD", "发票抬头", "COMPANY", "单位"),

    //会员收藏类型
    SCRM_COLLECT_TYPE_ITEM("SCRM","COLLECT_TYPE","会员收藏类型","ITEM","商品"),
    //分类类型
    CNT_CATEGORY_TYPE_TOPIC("CNT","GATEGORY_TYPE","内容分类类型","TOPIC","专题"),
    CNT_CATEGORY_TYPE_HELP("CNT","GATEGORY_TYPE","内容分类类型","HELP","帮助"),
    ;
    private final String model;
    private final String code;
    private final String codeName;
    private final String valueCode;
    private final String valueCodeName;

    UdcEnum(final String model, final String code, final String codeName, final String valueCode, final String valueCodeName) {
        this.model = model;
        this.code = code;
        this.codeName = codeName;
        this.valueCode = valueCode;
        this.valueCodeName = valueCodeName;
    }

    public String getValueCodeName() {
        return valueCodeName;
    }

    public String getValueCode() {
        return valueCode;
    }

    public String getMsg() {
        return valueCodeName;
    }

    public String getModel() {
        return model;
    }

    public String getCode() {
        return code;
    }
    
    public String getCodeName(){
        return codeName;        
    }


    public static UdcEnum matchValueCode(String valueCode) {
        for (UdcEnum opCode : UdcEnum.values()) {
            if (opCode.valueCode.equalsIgnoreCase(valueCode)) {
                return opCode;
            }
        }
        return null;
    }

}
